<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<link rel="stylesheet" href="<%=basePath%>/plugins/layui/css/layui.css"
	media="all" />
<link rel="stylesheet" href="<%=basePath%>/css/login.css" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@ include file="/common/pre/header.jsp"%>
<script src="${ctx}/statics/js/backend/backend.js"></script>
<script type="text/javascript" src="<%=basePath%>js/jquery-1.8.3.js"
	charset="utf-8"></script>
</head>
<body>
	<c:if test="${user == null}">
		<c:redirect url="login.jsp"></c:redirect>
	</c:if>

	<!--End Header End-->
	<div class="i_bg bg_color">

		<!--Begin 用户中心 Begin -->
		<div class="m_content">

			<%-- <input type="submit" value="返回" class="s_btn" onclick="window.localhost.href='/1and5Demo/repairList/findR2?computerId=${computerId}&computerroomId=${computerroomId}'"/> --%>

			<div class="m_right" id="content">
				<div class="mem_tit">
					<!-- 
                <c:choose>
                    <c:when test="${empty user.id || user.id==0}">
                        添加用户
                    </c:when>
                    <c:otherwise>
                        修改用户
                    </c:otherwise>
                </c:choose>
                 -->
				</div>

				<form action="/1and5Demo/repairList/upId" method="post">

					<table border="0" class="add_tab" style="width: 930px;"
						cellspacing="0" cellpadding="0">

						<tr>
							<td width="135" align="right">电脑编号</td>
							<td colspan="3"><input type="text" value="${r.computerId}"
								class="add_ipt" name="computerId"  <c:if  test="${user.roName =='组长'|| user.roName =='维修人员'||user.roName =='老师'}">disabled="disabled"</c:if>  /> <input
								type="hidden" name="id" value="${r.id }" /></td>
						</tr>

<tr>
							<td width="135" align="right">损坏情况</td>
							<td>
								<select name="faultId" <c:if test="${user.roName =='组长'|| user.roName =='维修人员'||user.roName =='老师'}">
									disabled="disabled"
								</c:if>>

									<c:forEach items="${faultList}" var="desc">
										<c:if test="${desc.id == r.faultId}">
											<option value="${desc.id }" selected="selected">${desc.faultName }</option>
										</c:if>
										<c:if test="${desc.id != r.faultId}">
											<option value="${desc.id }">${desc.faultName }</option>
										</c:if>
									</c:forEach>
								</select>
							</td>
						</tr>

				<!-- -
						<tr>
							<td width="135" align="right">设备情况</td>
							<td><select name="faultId" id="faultId"  <c:if  test="${user.roName =='组长'|| user.roName =='维修人员'||user.roName =='老师'}">disabled="disabled"</c:if> >
									<option value="1">显示屏损坏</option>
									<option value="2">键盘损坏</option>
									<option value="3">鼠标损坏</option>
									<option value="11">手机袋损坏</option>
									<option value="5">桌子损坏</option>
									<option value="6">椅子损坏</option>
									<option value="7">空调损坏</option>
									<option value="8">缺少键盘</option>
									<option value="9">缺少鼠标</option>

							</select>
				 -->
						 <%--  <c:if test="${r.faultId == 1}">
                         	<option value="1" selected="selected">显示屏损坏</option>
	                         </c:if>
	                         
	                         
	                         <c:if test="${r.faultId == 2}">
	                         <option value="2" selected="selected">键盘损坏</option>
	                   
	                         </c:if>
	                         
	                         <c:if test="${r.faultId == 3}">
	                           <option value="3" selected="selected">鼠标损坏</option>
	                        
	                         </c:if>
	                         
	                       <c:if test="${r.faultId == 4}">
	             
	                        	<option value="4" selected="selected">手机袋损坏</option>
	                        
	                       </c:if>
	                       
	                        <c:if test="${r.faultId == 5}">
	                        <option value="5" selected="selected">桌子损坏</option>
	                        
	                  
	                       </c:if> 
	                       
	                       <c:if test="${r.faultId == 6}">
	                
	                        	   <option value="6" selected="selected">椅子损坏</option>
	                        
	                       </c:if>
	                         <c:if test="${r.faultId == 7}">
	
	                        	  <option value="7" selected="selected">空调损坏</option>
	                        
	                       </c:if>
	                       
	                       <c:if test="${r.faultId == 8}">
	           
	                        	 <option value="8" selected="selected">缺少键盘</option>
	                        
	                       </c:if>
	                       
	                 		<c:if test="${r.faultId == 9}">
	               
	                        		<option value="9" selected="selected">缺少鼠标</option>
	                        
	                       </c:if>
	                     
     						</select>
     						 --%></td>


						</tr>



						<tr>
							<td width="135" align="right">损坏时间</td>
							<td><input type="date" value="${r.faultTime}"
								class="add_ipt" name="faultTime"  <c:if  test="${user.roName =='组长'|| user.roName =='维修人员'||user.roName =='老师'}">disabled="disabled"</c:if>  /></td>
						</tr>
<tr>
							<td width="135" align="right">所属机房</td>
							<td>
								<select name="computerroomId" <c:if test="${user.roName =='组长'|| user.roName =='维修人员'||user.roName =='老师'}">
									disabled="disabled"
								</c:if>>

									<c:forEach items="${computerroom}" var="desc">
										<c:if test="${desc.id == r.computerroomId}">
											<option value="${desc.id }" selected="selected">${desc.computerroomName }</option>
										</c:if>
										<c:if test="${desc.id != r.computerroomId}">
											<option value="${desc.id }">${desc.computerroomName }</option>
										</c:if>
									</c:forEach>
								</select>
							</td>
						</tr>

						<!-- -
						
						
						
						<tr>
							<td width="135" align="right">所属机房</td>
							<td>
								<%-- <input type="text" value="${r.computerroomId}" class="add_ipt" name="computerroomId" id="computerroomId"/>
                         --%> <select name="computerroomId"
								id="computerroomId" disabled="disabled">
									<option value="1">1机房</option>
									<option value="2">2机房</option>
									<option value="3">3机房</option>
									<option value="4">4机房</option>
									<option value="5">5机房</option>
									<option value="6">6机房</option>
									<option value="7">7机房</option>
									</select>


							</td>

						</tr>

									
						 -->
									<script>
                              		
	                              	$(function(){
	                              		
	                              		$("#computerroomId option[value='"+${r.computerroomId}+"']").attr("selected","selected");
	                              		$("#faultId option[value='"+${r.faultId}+"']").attr("selected","selected");
	                              		
	                              		
	                              	});
                              	</script>


						<tr>
							<td width="135" align="right">所属年级</td>
							<td>
								<%-- <input type="text" value="${r.classroomId}" class="add_ipt" name="classroomId" id="classroomId"/> --%>
								<select name="classroomId"  <c:if  test="${user.roName =='组长'|| user.roName =='维修人员'||user.roName =='老师'}">disabled="disabled"</c:if> >

									<c:forEach items="${classroomInfo}" var="desc">

										<c:choose>

											<c:when test="${desc.id == r.classroomId}">
												<option value="${desc.id }" selected="selected">${desc.className }</option>
											</c:when>

											<c:otherwise>
												<option value="${desc.id }">${desc.className }</option>
											</c:otherwise>

										</c:choose>

									</c:forEach>
							</select>
							</td>
						</tr>

						<tr>
							<td width="135" align="right">教 员</td>
							<td>
								<%-- <input type="text" value="${r.teacherId}" class="add_ipt" name="teacherId" id="teacherId"/> --%>
								<select name="teacherId"  <c:if  test="${user.roName =='组长'|| user.roName =='维修人员'||user.roName =='老师'}">disabled="disabled"</c:if>  >

									<c:forEach items="${teacherList}" var="desc">
										<c:if test="${desc.id == r.teacherId}">
											<option value="${desc.id }" selected="selected">${desc.teacherName }</option>
										</c:if>
										<c:if test="${desc.id != r.teacherId}">
											<option value="${desc.id }">${desc.teacherName }</option>
										</c:if>
									</c:forEach>
							</select>

							</td>
						</tr>



<tr>
							<td width="135" align="right" >审核状态</td>
							<td><select name="statusId">
							
									
							<c:if test="${user.roName =='维修人员' }">
									<option value="2" selected="selected" >待审核</option>
									
							</c:if>	
							
									
							<c:if test="${user.roName =='老师' }">
									<option value="3" >审核通过</option>
									
							</c:if>	
							<c:if test="${user.roName =='管理员'}">
									<option value="1" selected="selected">已提交</option>
									<option value="2" >待审核</option>
									<option value="3" >审核通过</option>
							</c:if>
								

							</select>
							</td>
						</tr>
						

						<tr>
							<td></td>
							<td><input type="submit" value="保存信息" class="s_btn"
								onclick="checkDisabled()" /><br /></td>
							<td><input onclick="window.history.back();" class="s_btn"
								value="返回" /></td>

						</tr>

					</table>
				</form>

			</div>
		</div>
	</div>
	<script type="text/javascript"
		src="<%=basePath%>/plugins/layui/layui.js"></script>


	<script type="text/javascript">
		//提交的时候释放
		function checkDisabled(){

			$('form select').removeAttr("disabled"); 
			$('form input').removeAttr("readonly"); 
			$('form input').removeAttr("disabled"); 
		}
	</script>
</body>
</html>


